<%@ page language="java" pageEncoding="utf-8"%>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>资产信息详细列表分页显示</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="/layer/layer.css" />
<script src="/layer/jquery-3.6.0.min.js"></script>
<script src="/layer/layer.js"></script>
<script src="${pageContext.request.contextPath }/layui/layui.js"></script>
</head>

<body>

	<fieldset class="layui-elem-field">
		<legend>资产详细信息列表</legend>
		<div class="layui-field-box">
			<div class="layui-form">
				<form action="/chaxun" method="post">
					<div class="layui-row layui-col-space10">
						<div class="layui-col-md2">
							<lable> 请选择查询条件： </lable>
						</div>
						<div class="layui-col-md2">
							<select name="dept">
								<option value="0">请选择部门名称</option>
								<option value="保安部">保安部</option>
								<option value="科技组">科技组</option>
								<option value="人力资源部">人力资源部</option>
								<option value="设备管理部">设备管理部</option>
								<option value="外贸部">外贸部</option>
								<option value="总务处">总务处</option>
							</select>
						</div>
						<div class="layui-col-md2">
							<select name="type">
								<option value="0">请选择设备类型</option>
								<option value="办公用品">办公用品</option>
								<option value="笔记本">笔记本</option>
								<option value="电脑软件">电脑软件</option>
								<option value="电脑硬件">电脑硬件</option>
								<option value="服务器">服务器</option>
								<option value="手机通信">手机通信</option>
								<option value="数码产品">数码产品</option>
								<option value="数码配件">数码配件</option>
								<option value="拓展配件">拓展配件</option>
								<option value="网络设备">网络设备</option>
								<option value="无线网络">无线网络</option>
							</select>
						</div>
						<div class="layui-col-md2">
							<input type="submit"
								class="layui-icon layui-icon-search layui-btn layui-btn-primary"
								value="查 询">
						</div>
						<div class="layui-col-md2">
							<a name="add" type="submit" class="layui-btn layui-btn-primary"
								id="add" href="/to_zcinfo_add">添加资产</a>
						</div>
					</div>
				</form>
			</div>
		</div>
	</fieldset>
	<!-- 	数据表格 -->
	<table class="layui-hide" id="test" lay-filter="demo"></table>
	<script>
		layui.use([ 'table' ], function() {
			var table = layui.table;
			var $ = layui.jquery;

			table.render({
				elem : '#test',
				data : ${zc_list},
				cellMinWidth : 100 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
				,
				cols : [ [ {
					field : 'zcId',
					width : 150,
					title : '资产编号',
					sort : true
				}, {
					field : 'zcNo',
					width : 150,
					title : '资产型号'
				}, {
					field : 'zcName',
					title : '资产名称'
				}, {
					field : 'zcPrice',
					title : '单价',
					sort : true
				}, {
					field : 'zcFactory',
					title : '生产厂商'
				}, {
					field : 'zcProducetime',
					title : '生产日期'
				}, {
					field : 'zcBuytime',
					title : '入库时间'
				}, {
					field : 'zcBuyer',
					title : '购买人'
				}, {
					field : 'zcType',
					title : '资产类型'
				}, {
					field : 'zcStatus',
					title : '状态',
					sort : true
				}, {
					field : 'zcId',
					title : '操作',
					width : 178,
					align : 'center',
					toolbar : '#barDemo'
				} ] ],
				page : true
			});

			//监听工具条
			table.on('tool(demo)', function(obj) {
				var data = obj.data;
				if (obj.event === 'update') {
					window.location.href = "/updateAssets?zc_id="
							+ obj.data.zcId;
				}
				if (obj.event == "remove") {
					layer.confirm('确定删除此数据吗?', {
						btn : [ '确定', '取消' ]

					}, function() {
						window.location.href = "/deleteAssets?zc_id="
								+ obj.data.zcId
					});
				}
			});
		});
	</script>
	<script type="text/html" id="barDemo">
			<a class="layui-btn layui-btn-primary layui-btn-xs"  lay-event="update">修改</a>
			<button class="layui-btn layui-btn-primary layui-btn-xs"  lay-event="remove">删除</button>
	</script>

</body>
</html>
